Skip to content

Conversation

@rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Dec 8, 2022

Closes: #8350

Description

Adds a new analytics event to track when date range selection fails, to detect and better understand problems with specific calendars, time zones, and dates:

  • analytics_hub_date_range_selection_failed (Event registration: 1240-gh-tracks-events-registration)

This event is triggered when a AnalyticsHubTimeRangeSelection.TimeRangeGeneratorError is thrown in the Analytics Hub.

Testing

You can force a failed date range selection by temporarily editing one of the methods that unwraps the time range to always throw an error:

func unwrapCurrentTimeRange() throws -> AnalyticsHubTimeRange {
guard let currentTimeRange = currentTimeRange else {
throw TimeRangeGeneratorError.selectedRangeGenerationFailed
}
return currentTimeRange
}

To test:

  1. Build and run the app.
  2. Tap the "See more" button.
  3. Confirm the event analytics_hub_date_range_selection_failed is triggered with custom props option (with the selected date range option), calendar (with your device calendar), and timezone (with your device timezone).

Alternately, you can edit one of the methods in Date+StartAndEnd.swift to return nil. In that case, the event should be triggered when you select the relevant date range in the Analytics date range selector.

Submitter Checklist

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@rachelmcr rachelmcr added the category: tracks Related to analytics, including Tracks Events. label Dec 8, 2022
@rachelmcr rachelmcr added this to the 11.6 milestone Dec 8, 2022
@rachelmcr rachelmcr marked this pull request as ready for review December 8, 2022 18:09
@wpmobilebot
Copy link
Collaborator

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8359-29c24f0 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

Copy link
Contributor

@ealeksandrov ealeksandrov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:
I've noticed error events are duplicated, but that's unrelated to this PR, it's about 2 parallel updateData() requests - I'll take care of it separately.

@rachelmcr
Copy link
Contributor Author

I've noticed error events are duplicated, but that's unrelated to this PR, it's about 2 parallel updateData() requests - I'll take care of it separately.

Thanks! I missed that.

@rachelmcr rachelmcr merged commit e3c8dd8 into trunk Dec 9, 2022
@rachelmcr rachelmcr deleted the issue/8350-track-date-selection-failures branch December 9, 2022 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category: tracks Related to analytics, including Tracks Events.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Analytics Hub] Track date selection failures

4 participants